#!/usr/bin/ruby

Commands.add_command(:total_memory,Proc.new do
                       size=0
                       File.readlines("/proc/meminfo").each do |line|
                         if line=~/^MemTotal:\s+(\d+)\s+(\S+)/
                           size=$1.to_f
                         end
                       end
                       "%.2f %s"%[size/1024,'Mb']
                     end)
